<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
    xmlns:dssp="http://schemas.microsoft.com/xw/2004/10/dssp.html"
    xmlns:lcd03="http://www.robot-electronics.co.uk/2006/10/lcd03hardware.html"
    >

  <xsl:import href="/resources/dss/Microsoft.Dss.Runtime.Home.MasterPage.xslt" />

  <xsl:template match="/">
    <xsl:comment>
      <!-- Service Header Info -->
    </xsl:comment>
    <xsl:variable name="title">
      LCD03 Hardware Service
    </xsl:variable>
    <xsl:variable name="serviceName">
      LCD03 Hardware Service
    </xsl:variable>
    <xsl:variable name="description">
      The I2C and serial display driver provides easy operation of a standard 20*4 LCD Text display. It requires only a 5v power supply and the two data connections for either mode, freeing up pins on your processor.
    </xsl:variable>

    <xsl:call-template name="MasterPage">
      <xsl:with-param name="serviceName" select="$serviceName" />
      <xsl:with-param name="description" select="$description" />
      <!-- If title is not provided, serviceName will be used instead. -->
      <xsl:with-param name="title">
        <xsl:value-of select="$serviceName" />
        <xsl:if test="$title != ''">
          <xsl:text> - </xsl:text>
          <xsl:value-of select="$title" />
        </xsl:if>
      </xsl:with-param>
      <!-- Possible values for navigation are: 'Open', 'Closed', and 'None'
           'Open' is the default value. -->
      <xsl:with-param name="navigation" select="'Open'" />
      <!-- The contents of head param will be placed just before the </head> tag in html. -->
      <xsl:with-param name="head">
        <link rel="stylesheet" type="text/css" href="/resources/I2CHardware/Devantech.Services.I2C.Hardware.resources.DevantechI2CHardware.Stylesheet.css" />

        <style type="text/css">
          /* Service-specific stylesheet goes here */
        </style>
        <script language="javascript" type="text/javascript">
          <![CDATA[<!--

/* Service-specific script goes here */

dssRuntime.init = function()
{
  // Add page initialization code here.
  // This function is attached to the window.onload event.
  // Do not override window.onload.
}

//-->     ]]>
        </script>
      </xsl:with-param>
    </xsl:call-template>
  </xsl:template>

  <!-- Match service state's document element. -->
	<xsl:template match="/lcd03:LCD03HardwareState">
				<div class="Module">
					<form method="POST" >
						<fieldset>
							<legend>Update DisplayText</legend>
							<br/>
							<div>
								<label for="Text">Text:</label>
								<span>
									<input type="text" name="Text">
										<xsl:attribute name="value">
											<xsl:value-of select="lcd03:DisplayText"/>
										</xsl:attribute>
									</input>
								</span>
							</div>
							<br/>
							<input type="submit" value="Update DisplayText" class="OrangeButton" />
						</fieldset>
					</form>

					<form method="POST" >
						<fieldset>
							<legend>Update Backlight</legend>
							<br/>
							<div>
								<label for="On">Backlight:</label>
								<span>
                  <select  class="Editable" maxlength="5" name="On" 
											id="On"  title="Click to change delay between polling"
											type="text" >
                    <xsl:choose>
                      <xsl:when test="lcd03:BackLight = 'true'">
                        <option value="true" selected="selected">On</option>
                        <option value="false">Off</option>
                      </xsl:when>
                      <xsl:otherwise>
                        <option value="true">On</option>
                        <option value="false" selected="selected">Off</option>
                      </xsl:otherwise>
                    </xsl:choose>
                  </select>
								</span>
							</div>
							<br/>
							<input type="submit" value="Update Backlight" class="OrangeButton"/>
						</fieldset>
					</form>
					
				</div>
				<br clear="all" />
				<div class="hr"></div>
        <div class="RightColumn">
          <a class="LinkSmall" 
						href="http://www.robot-electronics.co.uk/htm/Lcd03tech.htm" 
						target="_new">View Documentation...</a>
        </div>
				<span class="SmallText">Config at: /store/Devantech.Services.LCD03.Hardware.xml</span>
				<br/>
	</xsl:template>
</xsl:stylesheet>
